fix a deletion bug

if dir != "." the deletion would be a bug
Merge pull request #2 from doomsplayer/patch-1

fix a deletion bug