What's the difference between total function and count function?
.count will return the total results for a particular paginated page (in your case, it should be the same as the resultsLimit variable).

.total will return the number of results in the entire results object regardless of pagination.