Fixing bug on DB object