fixed bad variable reference