Bug fix header parsing, if no msg is returned

Bug fix header parsing, if no msg is returned