fixing more issues with pagination