fixed db init stuff