added login to the controller