Add check for mutability to serialization selection