fixed db consistency issue