add dbscript and modify some codes