fixed some errors on index