protect against npe when headers are null