fix JS snippets