Billy is now 5 and a half months old and i love having him, he always wants to be with me, follows me everywhere and just wants to please me all the time

The problem i've been having is when i take him and Alfie for a walk, Billy will run after the ball, bring it back, throw it at me and then bark non stop till i throw it again

i've been trying so hard to stop the barking, especially when i stop to talk to people cos he will bark the whole time. I have been trying not to throw the ball until he's quiet but he's just not getting it

so today i took a water pistol with me, ideally i would prefer to be able to stop him barking without uising it but i don't want the barking to become a habit. So when he barked, i squirted him once, not in the face but on his body and was totally surprised by his reaction

He then didn't want to even chase the ball, he kept by my side and i had to make a big fuss of him and encourage him to chase the ball

after a minute or so he was happily chasing it again and hardly barking for it after he'd thrown it at me
I don't mind him barking when he's playing, i just wanted to stop him barking when i was talking to people so i decided not to use the pistol unless i was talking and he was barking as i felt awful that he reacted the way he did!
A man with 2 dogs stopped to chat and sure enough Billy barked for the ball to be thrown, i told him to be quiet but he continued so i only had to show him the water pistol and he shot between my legs and laid at my feet and i then made a fuss of him for being quiet.
My question is.... is what i'm doing harmful in anyway? it definately worked becos he didn't bark much at all for the ball and i only used the pistol once but i don't want to make him scared of me or make him unhappy. Its the first time i've ever had to "tell him off" for something so i was surprised at how sensitive he is.
Am i a bad mum?
