make Events thread-safe