CG-2786: fixed referencing wrong variable