rm to use rmdir when called on a directory