fixed pagination bug, added TODO
Fixes to the pull requests.