add supput for enum and fix bug