fix bug with step_ calculation