updating bst stack