Fix infinite page bug