added auto switch