Added onClose event to WS Socket ro reconnect to the server