return values to vars and change js tpl