fixing headerBuilder function