Make sure we set the write flag when emitting messages