Please help me finding the bug

This code is not returning anything(or returning NULL).

```
public:
void maketree(vector<int>& nums,TreeNode *root,int start,int end){
if(start>end)return;
int mid=start+(end-start)/2;
root = new TreeNode(nums[mid]);
maketree(nums,root->left,start,mid-1);
maketree(nums,root->right,mid+1,end);
}
TreeNode* sortedArrayToBST(vector<int>& nums) {
TreeNode *root=NULL;
maketree(nums,root,0,nums.size()-1);
return root;
}
};
```