updated struct_send function