fixed a bugs related to browsing directories