fix bug. avoid duplicates in binary search tree