fix the enum write&read bug