Used getter instead of variable Ref.

Used getter instead of variable Ref.