before swap