segment callback impl