debugging for writing the pagination fix code