added error handler to login
formatting