fixed reference swapping