close connection on ws error