I'm in need of some help please

Maria • I`m happily married, & I am a new mommy to a beautiful baby boy & with my new little girl. My life is now complete 💚💜
So my son who is 1 (going to turn 2 in September) he has been kicking recently when I try to change his diaper ir when I try to put him some pants on him. The problem is that he kicks are really hard and he is always kicking my stomach & I am currently 16 weeks pregnant and I recently had surgery also. I told him to stop that it's not nice to kick mommy but the more I say it that harder he kicks me. One time he kicked me really hard that I was bleeding from my surgery cut and I reacted by spanking his butt..he didn't cry, he was just surprised that I did that. And when I realized what I done I started to cry. I told my husband about it and he said I did what I had to do for him to stop kicking me in the stomach. But I still feel bad about it and it hasn't work..he still kicks me when I change his diaper..I don't want to spank him again but I don't know how to make him stop or what can help him not to kick during diaper changes. I tried turning on tv but that doesn't works nor giving him a toy for him to play while I do that. I was just wondering if any of you ladies ever gone through this. And if so can you help me out. Thanks in advance and sorry that it's a long post.