BUG: Fix missing if statement in script