Add 'Return to main page' link and corresponding socket.io logic