Updated snippet, create script file on register and changed link to file