tried to update error handling