fix segmentation fault bug

remove comparator before delete