fix headers outputted by handler