AdvancedConnect and Disconnect functions