fix bugs in ranked relevance