Fixed bug where pagination crashed