interfacing rfid troubleshoot

hi, i am working on a project which reads an rfid tag using an em18 reader and sends the id through serial coms to the pc. Unfortunately i happen to receive multiple values of the id. Like if 12345678 was an id, the i would be receiving 1234567812 45678123 etc. Any helps would be appreciated.

int id=12;
char input[12];
int sensor;
int status=13;

void setup()
{
  Serial.begin(9600);
 
  pinMode(13,OUTPUT);
  pinMode(status,OUTPUT);
  pinMode(id,OUTPUT);
  
}

void loop() 
{
int off=5;
int on=10;
sensor=analogRead(A0)/12;
delay(10);
if (sensor>5)  //this is an ldr which would enable or disable rfid reader
  {
  
   digitalWrite(status,LOW); 
   digitalWrite(id,LOW);   //disable rfid

  }
else
  { 
   digitalWrite(status,HIGH);
   digitalWrite(id,HIGH);  //activate rfid

                                        if(Serial.available())
                                            { 
                                              count=0;
                                                while(Serial.available()&&count<12)
                                                  {
                                                    input[count]=Serial.read();
                                                    count++;
                                                    delay(5);
                                                  }
                                              Serial.write(input);
                                              delay(1000);
                                            }
                                               
  }
}

What is connected to the Serial port? Is it the PC or the RFID reader? Both is the wrong answer.

input is NOT a string. Do not attempt to use it like it is a string. A string is a NULL terminated array of chars. You have not bothered to NULL terminate your array, so it is NOT a string, and should not be passed to functions that expect strings.