Modified the procedure of GUI.