How can I avoid errors using a complex snippet when I need to re-run the snippet because I want to change an initial variable?