fix bug handling enumerations
Merge pull request #1933 from wmtan/FixBugHandlingEnums

fix bug handling enumerations