fixed invalid reference
fixed var case typo