added check for index accessing mat_index_entries