Add check so that we don't try to connect while already making an attempt