fixed db update bug