add level check in BST problem