fix invalid step index