replace bool type by unsigned char type