error handling added to login and register