Add better header handlling