undefined variable error removed