fixed bugs in script.class