deal with pagination issue