add header count and messages
merge master