corrected file creation and deletion