bug fix in db model