fixed a socket connection bug for clearing the canvas