stuff
added isSwapping condition
fix code