Added some basic error handling in login controller