fixing missing var problem