modified add template to conform to js modification in previous commmit