use local variable to fix syntax error