Can I get pregnant on my period?!

So I'm on a type of birth control that's an IUD, now my boyfriend has cum in me before and I didn't get pregnant, but now that I'm on my period he just came inside me.. Do I have a higher chance of getting pregnant that way? Or will my IUD still prevent it..