bug fix in Swap