Properly shut down listener