changed code to work with loginController, etc