fix index issue
fixes index bug