getting the right index. part of #455