fix js code in template