fix the js template error that would lead to crash when do rotate
Merge pull request #219 from samuele3hu/bug_fix

fix the js template error that would lead to crash when do rotate