undo db bug fixing