more error handling cleanup