Here is the code:
I am so confused why same code make different outcome. Any help would be appreciated.
Problem solved. The reason causing the failure is insufficient gas.