added more robust error handling. clients can disconnect independently now