Use a for loop rather than for/in loop when copying events, so that code will work...