change rmdir functionality