Fixing on QUIT detection