fix listing empty dirs and dirs without permissions