modified the controller