adding the switch between stages