fix db loading bug