check for errors in serialization and deserialization