updates cardstream tpl javascript function