improve paging, js tests