fixed Snap not defined error