fixing header 'undefined' issue