Fixing issue with deprecated way of looking up variables