fixed db save bug