fix the onLoad pagination bug