fixed the injection process so that snippets are now injected correctly