bugfix: instead of just any only the last step should reach the goal