Remove extra script end tag from template