What a short memory you have. Merkel and other European countries allowed a wave of refugees in because it was a CRISIS. And in circumstances like that it's probably better to open the gates and at least identify them all as they come in, rather than have them sneak in behind your back.

There's no evidence to connect this crime to the refugees that Merkel let in. Nor is there any sound reason to strongly connect immigration to terrorism, even if an immigrant perpetrates it. Islamic State will just send someone if they can't convince a local to do it.

Unless a country utterly closes its borders, it's vulnerable to an attack such as this.