added onPage callback