fix serializacion problem with Unsafe