fixed bug with directory recursion