fixed bug on scripts