PLEASE HELP

I was already on my last week on the pill (white ones) I knew any day my period could arrive yet I had sex around the end of the white pills, my boyfriend ejaculated in me and the next day I got my period. I'm not sure if that was wrong, risky or if I could be pregnant? I now have ended my period since yesterday started a new packet on the pill. Should I not have sex on the last week?