fix db update code from crashing on upgrade