correctly set mergeVars for render in templates api