use st monad for ffi calls