Invalid reference to variables