updated error text and error handling