change enum to enum type; add enum check