error handling corrections