Fix ranking users query