A dog barks as a sign of distress.
One of the following sentences is nonsensical. Which one is it?

A. "the dog barks to show its kindness to its owner."
B. "the dog wags its tail to show its kindness to its owner."