#361 fix JS handling optimum and perpage changes