added FFI serialization