updated database init routine