Please help need advice

I've been married for a couple of years now and have a baby together. About a year ago i ran into my ex Ever since then i can't stop thinking about him. Things lately haven't been the best between hubby and me. He doesn't help in any way and doesn't spend much time with me or our baby (but has tried to improve by staying home instead of at friends) also been acting differently (Feels like he maybe hiding something or feels differently but doesn't want to fight). He has never really been the gentleman type and doesn't talk to me the way how I'd like to be. But my ex was the opposite. He was a complete gentlemen. I broke it off because I wasn't in the right mind set for a relationship and needed to work on myself. We never got any closure. Am i just thinking about him because he has been the only man to have treated me the way I deserve to be or something deeper? I know that I'm married with a family and should be focusing on them but if I'm thinking about him and questioning if I've made the right choices what does that say? I do love my husband and don't want to hurt him at all. But how can i stop thinking about my ex..