error handling for login and signup