fix to connectionAttempt counting so that maxConnectionAttempts works