Listen to "quit" event