fix quitting process