removed unnecessary code from controller file