Fixed db error issue