Fix var scope