cleaning up and adding onConnectionAccepted callback