bug fix in db_tools