copy the input headers object #1060

Use a copy of the input headers, closes #1060