fix variable name
fix access to undefiend variable