Add connection boolean in main