fixed db upgrade