Error: "flatmap states cannot be unmarshaled..."