Fixed bug in controllers