Treeview inside Window editor is not scrolling.

As you can see in the image attatched. The treeview does not scroll even though it is a huge list of items.
Things I have tried so far

float startY = controlRect.y + controlRect.height + 12;
            Rect r = new Rect(0, startY, position.width, position.height - startY);


            m_TreeViewState.scrollPos = EditorGUILayout.BeginScrollView(m_TreeViewState.scrollPos, true ,true,
                GUILayout.Width(r.width) , GUILayout.Height(r.height));

            
            m_SimpleTreeView.OnGUI(r);

            
            EditorGUILayout.EndScrollView();
            
            EditorGUILayout.EndVertical();

I have also tried toggling useScrollView. all to no effect. Can someone tell me what I am doing wrong? thank you very much.

solved the issue by not reinitializing a treeview on the onGUI.