make sure app close