Improved listener shut down handling