Fixing db error