Fixed pagination issue