js snippets fix