new db logic