Reference error fixed