fix a bug in Ranking