add swap event listener