fix delete DB bugs.