emit error on invalid header
Merge pull request #11 from dominictarr/master

emit error on invalid header