Added some functionality to LoginCtrl