template correction