event termination function added