replace insertSnippet with addSnippet