fix resolve-var impl