switch behavior working