fix ffi type check