fix minor bug in recursive directories