Husband not attracted to me

My husband said he isn’t attracted to me whenever I am nagging at him or mad at him. It made me super mad and now I feel like he’s not attracted to me at all. I brought this up to him and he said he is attracted to me, just not when I’m on him about certain things. Has anyone else’s husband said this to them?? I feel horrible now.

Edit: I would also like to add that I am nagging about him not giving me affection like he used to, and how it affects me.