directory looping first iteration