RC522 RFID - Swapping cards in the middle of a sketch

Hi folks,

So, i am trying to read one sector(excluding sector0) of data from one card and copy data into the same sector of another card.
Using the code present in GitHub - miguelbalboa/rfid: Arduino RFID Library for MFRC522 library, i made a code which reads the data from the specified sector, stores the data in the variables and writes it back to the card present on the RC522 module.
The idea behind this code was that i read the data from card A, put a delay of some 10 seconds so that i can remove card A from the rc522 module and put card B on it and the writing part is done on card B once the delay time is over.

In the current scenario, once the above explained code reaches the delay part, I remove the card A from the rc522 and put the same card back on top of it. But, when the writing part tries to execute, the serial monitor throws the below error :
"PCD_Authenticate() failed: Timeout in communication."

Does anyone has any idea that if a card is taken off and then put back when the code is in 'delay' mode, why the error is thrown on the serial monitor? It is the same card with same UID and same trailing block, not sure why this behaviour.

Any help will be appreciated !

The answer is easy - post the code HERE Don't link to tibin etc no one will read them.

Mark