fixed bug, getting correct swap value