fix db save bug