Fix the sslocal_flag issue

if the global var is used in function. The var should be statement
first.