fix bugs. new db script