fix quit bug