some modifs, added Script validation