Updated code for CreateEvent