changed pagination version and adapted code to work with new version