added mouse events, added thread-safety for events