Fix bug the directories were deleted