Accounting for secondary extinction in a novel X-ray absorption method used for thickness measurements of thin foils