Update gui.py

Fixed a bug reported by afro