assign db correctly