modified validate bst