Theory of mind in recognizing and recovering communicative failures