so I tried to make a power supply using Lm317 and it works fine when i used a 12 v transformer but when I used a 9-0-9 transformer like in the picture,when i turn potentiometer, it sparks and then the output become 23v and burnout .
here is the circuit that i used .
I don't know where the probem and I hope you can help me