make safe local variables work

Signed-off-by: coldnew <coldnew.tw@gmail.com>