Fixed connection leak. Added break statement after the first successful
connection that doesn't throw an error.