The second on is correct. The confusion lies in the fact that we normally don't pronounce the 'd' in 'used' distinctly; this is because of its proximity to 'to'. This mistake is made by many native speakers, so if you are learning English as a second language, don't feel bad!
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.