fix bug: rbtree key's uniqueness is not guaranteed by function