Added the open and close functionality in the GUI.