fix bug for code enum