added error handling for sign up and log in