added more error handling to response_file