fixed if statement in scripts