Fix error in main controller