fixing db error