fix sending bug, but still fails occasionally