builds in error handling for login