Fixed pagination problem