Serial Programming question

  if(Serial1.available())
  {
    sync=Serial1.read();
    //Serial.print(sync);
    if(sync==0xaa)
    {
      if(Serial1.available())
      {
        data=Serial1.read();

I can't see how that code can ever work. As soon as a character is available, you check to see if it is the sync byte. If it is, you check immediately whether another character is available. It won't be, you are sending data at 300 baud so it will take around 33ms for the next character to arrive. You need to wait until each character is available. You'll also need some way of knowing when you have reached the end of the message, so you can go back to waiting for the sync byte.