better error messages when shutting down the listener