make http listener more resilient to exceptions