update the plan add js function and template file