Add critical error flag support to gui.py