Added error handling on login