fix invalid variable reference