added check to ensure we do not fail if PyQt5 is not in sys.modules