fixed things with pagination (I hope)