Made a quit() method for UI class