before switch