fix a historical maxDepth bug