use local_variable_set if defined

use local_variable_set if method defined.