switching switch with if