[fix] wrapped the variable in anonymous function