Dog becoming aggressive

Hi ladies, I'm at my wits end I just really don't know what to do. My husband and I have an 8 month old rescue puppy who I always had issues getting her to listen to/respect me but ever since I got pregnant she's getting hostile and aggressive but only when we are alone together. She even bit my forehead last night when I went to lay on her chest. Meanwhile if my husband is home she's gentle happy and comes to cuddle with me the entirety of him being around. My husband is at the point where he wants to get rid of the dog because if she's like this now and I'm only 8 weeks pregnant whose to say she won't try to hurt our baby but I don't want to lose her did anyone else have an issue with their pets while pregnant and how did they deal?