add before/end/page/page_num processing to activities