Add error handling for login