Fixing bug in DB