fixed undefined variable access