added code to split around events