Updated the dialogue logic.