Make the template count function work in the production environment.