add repeated begin and end callback