Fix error on index

Was alerting NaN because was subtracting two strings.
The second was simply hitting an error and thus not alerting at all.