Fix rank bug when page > max