Fixed bad variable reference