Serial problem

In both the first and the second program, I sent the data while the micro-processor was delay,
My question is:
Why the data could not be processed in the first program, yet it could be processed in the second program?