some bugs on empty directory are fixed