bug when accessing variable