Clean up on connect if disconnected and immediately if connected