undefined variable issues solved.