My 8yo Jack Russell is a relatively well socialised dog and gets on well with dogs he is familiar with. However when he meets other dogs he will stand still and let them sniff him for about 5 seconds and then suddenly bark right in their faces. He doesn’t show his teeth or act aggressive but it’s not playful either, I assume it’s kind of a warning to the other dog. This happens on and off leash and gets some tuts from other dog owners. To stop this from happening I carry treats and if another dog is nearby I encourage him to focus on me and reward him ignoring the dog but sometimes other dogs run up to him and that’s when he goes rigid and barks. We live in an area with lots of green space and I want to be able to let him play without worrying, is it a warning like I assume or something else? How can I discourage this behaviour?