fix javascript snippets