implement rmdir and release