Added the condition

This condition will not allow the recursion to occur if the directory
exists.