Add the autoSwitch function

Added an autoswitch function which will run if given envs doesn´t match and autoswitch is not set to false. So you don´t have to do the changes all by hand if there is a problem. :stuck_out_tongue_winking_eye: