fix the DIR check for ls