template counter fixed