[TASK] Add additional safeguard in addHeaders()