Changed the Controller logic