fixed bug with file deletion