switching active and pending