Fixed template, no errors, but does not replace the loop.