Fixed scoping issue

Fixed scoping issue with viz() function that was causing errors when
used with other extensions