fix some issues with the empty directory