added enhanced serialization of enums