fixed the add_index