updates and fixes to pagination