fixed bug when specifying script type