fixed a typo
test if dir exists and removes it if it exists