only clean _tw_step if not null

fix a bug that happens when _tw_step is null. Also, the function now
returns this.