Headlight fault

The bulb blew on my 2012 Q7 , simple I thought after finding the hid bulbs were ?61 and fighting to get the headlight out
I replaced the bulb taking care not to touch the glass part, replaced the headlight and on came the light !! Then went off for a second and back on again
The light continues to keep going off then back on ! I have also now replaced the ballast unit and still the fault continues
Please can someone shed some light !!!

Sent from my iPad using Tapatalk
Light code needs to be cleared, you can either get a VAG tool or you'll have to take it to your dealer.