Fix issue when closing the application #33