added recursion for folders