rewrite convert_doc() and protect existing files