modify DB and dependent code by mike