added more attempts to set header
Added more attempts to set header