This is necessary due to some weird problem which I wasn't able to figure out (but which doesn't matter) that somehow causes the event to be called twice during testing, and thus the function was exploding