did appropriate error handling for file removal