My male doxie did this a lot when we got him. We taught him the command 'put it away'. lol

It took a while but we said those words and took him away from the situation then turned our back to him. He eventually got it but it took a lot of patience on my part.