another error handling fix