fix the bugs in comparator
update for ranker