fixing error handling fix