connect and disconnect working