bugfix for pagination