bugfixing pagination