Fix logic error in adding step IDs
Fix another logic error with adding unique step IDs