fixed errors with deleting nonexistent directories