fixed add_index stuff