Fix pagination bug when choosing a label