bugfix: the snippet ref would be reset at every time when the snippet is executed to make sure the ref is unique
make sure the snippet instance will be initialized only once(for rare cases that cannot be warranted in previous implementation)