fixed error when closing application

By adding a listener for exit and doing absolutely nothing in it. But it works