fix bug where handling a message from qt crashed due to the gui not being initialized