Does your dog escape from the yard? This article from K9-Coach might inspire a solution.
The 4th is fun, but your dog probably hates it.