removed unnecessary code in controller