fixes counting bug for pagination