fix bug with QApplication