fix pagination and change table