Fixing events manager, making priorityQueue optional