Semaphore to make sure that the initialization order goes as designed
Fixes for events and uis