Kathasaritsagara 17.114.29
And the people, seeing the two leaders, were about to put them to death, but they immediately turned into bob-tailed dogs. And in this transformation they suddenly remembered their former birth, and danced in front of Siva, and fled to him for protection. When the citizens, Bráhmans, merchants, and all, saw that, they were delighted at being free from fear of robbers, and went laughing to their houses. And then the delusion, that had possessed those two beings now turned into dogs, disappeared, and they awoke to reality, and in order to put an end to their curse, they fasted, and appealed to Siva by severe asceticism. And the next morning, the citizens, making high festival and worshipping Siva, beheld those dogs absorbed in contemplation, and though they offered them food, the creatures would not touch it.