can't read "referencetype": no such variable