fixed a bug in the updateGUI method