fix generating db