fix a deletion bug

if dir != "." the deletion would be a bug