fixed merge conflicts and added DB support