Yep, and guess what, we don't need to take in immigrants. Some people want to stop all immigration. If we end up taking a lot less immigrants but keeping out most Muslims, then that could be two good things.
The problem with basing it on countries with active terrorism is that you block Christian refugees who need help the most because they're in the midst of the jihad. That's unconscionable. If there's one kind of immigrant we should take it's someone in a peaceful religion who is helplessly under assault from terrorists.
Then, the policy should be to reduce or end immigration, period. Then, all these other issues become moot.
But currently, we have, as a nation, a very low birth rate. History has so far been unkind to countries with declining populations.