fixed vif reading code