Added small clause to check if the queue has been initialized