switch 'control' to 'loop' in template