Added error handling for login / registration. Work in Progress