fix retrieving previous substep

threw an error on the console