Added a quit functionality