Fix crash bug when a user QUITs