fixed var bugs