add a mechanism to keep bad classes out of the to dictionary serialization