dbscript and bug fix