fixed read-only db init issue