fix invalid step index

see #46