modify flexible array and add static_var