fixed problem with undefined vis variable