Use attach_node function on while controller

Call the attach_node instead of the attach_to_last function.

This pull request fix a problem using the ```While``` controller.  Is there a way I can add a unit test to the ```While``` controller?