updated delete file method