add indices.close and indices.open functions