tired of feeling like a bad mom

I cant count the number of times I've stayed up after putting my 3 year old son to bed and cried. I feel as I spend the whole day yelling at him or being frustrated over everything, even when he's doing Normal toddler stuff. I have became so short paticened and I do not know why. like tonihht and every night it's a fight to brush his teeth he runs from me and I either have to chase him which is hard to do at 8 months pregnant mind you, or keep hollaring at him or drag him to me. I snapped again tonight and spanked his leg and I immediately felt like shit knowing I could handled it better. my husband is only in from work on weekends so i do this by myself, I dont wotk I'm at stay at home mom. I'm so tried of feeling like I'm failing. my son still tells me 100 times he loves me but i feel so bad.