Use length, not count, to count the number of paginated objects on page. count counts them on all pages.
Tested the other use of pagination