nit: `validConnection = 0;`