Reference error fix