cut headers correctly