fix indices for issue #39