fixing enums serializing problems