Fixed exit key condition