fix wrapbuffer foreign import