You have done a great job in teaching your dog what to do and what not to do. He behaves perfectly for you and is obedient to all your rules. This is a great thing and you think you are done.
No, you are not done. Now the onus is on your shoulders. You need to be consistent in your actions and enforcement of the rules you have taught your dog. This consistency must cross all the situations where you and your dog interact.
Our problem is that we often think “never mind”, things can slide just this once. Unfortunately, your dog will not understand. Robin and I have a great dog training article that explains this and tells you what to do. Please read our article titled “Why is it Sometimes My Dog Just Misbehaves?”.