fix the bug in db