Fixed small bug in controller