fix iteration over pages