fix bug on script generator