fix ffi initialization