I had a dog once who would do that on ocassion. I would turn my back and say...fine girl...i am leaving. then that sweet wonder of a dog would run back almost like she was saying...Hey mama wait up. You are not going to let me go alone are you.
Teach the recall command and get them to obey it everytime. That should help. Dogs sometimes(in my opinion only) have a mind of their own.
Bookmarks