Fix bug in pagination (almost one off them