added quit handling; no need for quit button as this occurs automatically during tab close or refresh