Added index db initialization logic.