fix to edit_file to avoid build on exit