fix bug with remove element from TreeSet