state manager draw logic, please test