minor corrections for event.set() function placement