Now the leave button is functional