changed connect/ disconnect behaviour