Fixed error caused by invalid referencing