fixing a bug of no loop.
adding an example.