manage disconnection of socket when navigating out of pad.js