Changed logic of input switching