how to sell car with lien??

I sold a car with a lien once. What i did was take the buyer to the bank where i had my auto loan. Then i paid the autoloan off with the buyer with me and recieved the lien release right then and there. I then gave the lien release to the new owner to turn into the dmv when he goes to register it.