Added double buffering to event manager.