added missing call to setMaxDepth