fixed issue when dir listing is empty