Fixed db running bug