occasionally threads die due to bad status line (seems to be invalid HTTP code?). implemented handler