fix sort and page change with ajax