fixed database init problem