convert index to an int, otherwise index+1 will be a string concatenation, closes #2915