Added addToIndex function for maintenance mode