Set max_depth for directory recursion