add auto switch deploy code