fixed some reswap bugs