fix table sortin and pagination