fixed db errors