remove headers before copying them, so we dont get duplicated headers