Nuvaring effectiveness if taken out early

I started using Nuvaring to control my irregular periods. I ended up taking it out during the third week (not after) because I was having difficult side effects from it. I got my period the following week. The day after my period ended, I had unprotected intercourse using the withdrawal method. I inserted a new ring the following day. My question is, was I still protected, even though I took the ring out early, since my period had just ended, he pulled out, and I inserted a new ring immediately after?