Modified slightly the while-loop template. Added while loop completion in the plugin.