fix small bug with controller state management - refactor