work on error handling / Maybe instead of undefined/null from ffi