Implement a first try to synchronize access to event queue. It seems to work. Need to be written in a better way