fixed bug in db_init