resolve variable defined issue