Fix to keep pagination from going into the negative