Emergency Contraception

Hi ladies.. so I met up with my ex last night and we ended up having sex and he came inside me, no warning or nothing. I thought he was joking at first but he really did. I drove straight to a 24 hour chemist and purchased and took the morning after pill within 1 hour of having sex. Does me taking it straight after lower the chances of it NOT working? Any advice is welcomed. I’ve never had to used emergency contraception so I’m a little unsure about it.