Fix bug - wrong ordering of events in header checking