fixed bug in script threshold update from template