Exit bug fix