Fix bug when press back button to quit