fixed bug in scripts