fix duplicate var issue