bug fix in setting modes