error handling for file unlink