add directory manage function