fixes crash on Solaris when Unsafe is used