minor bug fix in index that was causing an error