adding logic to the LoginController