close perr
...handle leave