fix race condition where headersHelper runs before `headers` is exported