my astra g keeps putting the emmissions light on, i checked the fault codes & it said the afm & intake air temp sensor(maf) were faulty, i have just bought a new one from vauxhall & the light is off but it still has the same codes coming back after i clear the but with pd after p100pd & p110pd

does anyone have any ideas, someone told me it may be an ecu fault?