swap was not working due to passed pointed params