fix typo, and make listen thread into daemon to ensure smooth shutdown