fix a bug with enum