bug fixed for the index not using