Fixed a quit listener bug