fix pagination offset bug