error handling and view login