Made the gz an assignment tag, and updated the templates.

This should prevent multiple calls to the function.