fix error in db code
merge conflicts and error