Wireless serial error when multitasking

I am trying to run a program on LP3500 (wireless application kit) that uses 3 costates. The first one gets an input letter, the second one turn on a LED an accelerate the flashing time according to the letter input (‘m’ or ‘n’), and the third one sends a letter output back to the PC.
Depending on the moment that I send the input letter, the program stops for some seconds and all the output letters that were supposed to be sent seems to be put on the transmit buffer. When the program “returns”, all the letters on the transmit buffer are sent together. If the rabbit is not sending any letter back to the PC the error doesn’t exists.
Does anyone knows what is the error on the code??


#class auto

#define BINBUFSIZE 1023
#define BOUTBUFSIZE 1023

static int timer;

void main()
{
	auto int channel;
	auto int k, ctl_status;
   auto char letter;

   brdInit();
	serBopen(9600);
   serBwrFlush();
   serBrdFlush();
   serMode(1);

   timer = 0;
   letter = 'a';

   //turn off LEDS
   for(channel = 0; channel <= 3; channel++)
   {
   	digOut(channel, 1);
   }

   while(k != 'z')
	{
   	costate control always_on
      {
            ctl_status = wfd {k = cof_serBgetc();} //get serial input
				if(ctl_status < 0) abort;
            yield;

         	switch(k)
	         {

	            case 'm':
	               timer = timer + 10;
	               break;

	            case 'n':
	               if (timer > 10)
	               {
	                  timer = timer - 10;
	               }
	               break;
	      	}
      }

      costate led1 always_on   //flash LED
      {
         if(timer != 0)
         {
         	digOut(0, 0);
         	waitfor(DelayMs(10000/timer));
	         digOut(0, 1);
	         waitfor(DelayMs(10000/timer));
      	}
         else
         {
         	digOut(0,1);
         }
      }

      costate status always_on  //send serial output letter
      {
         wfd cof_serBputc(letter);
         letter++;
         if (letter == 'z')
         	letter = 'a';
         waitfor(DelayMs(200));
      }

	}

   serBclose();
}
________________________________________________________
tnx