was writing out at the end of the main match, even though the write is handled earlier in some cases