Fixed view error with $var in a function call