fixed db issues