resolving undefined variable