changing db logic