made some changes to file_delete