commit before switch