Fixed bad variable ref