Updated the example to make the loop function realy loop