adding the terminal switching