variable reference issue