sync js with template