adding script statement
refactoring script defintion
bugs fixed at script statement