corrected setmode