Changed function of switching protocol
Add spec for testing function of switching protocol