fixed deletion of files and directories