added the chord leave function