fix: only add headers when necessary