Thank you for your advice.
Yes, You are right and it is because of a missing bracket.

The working script is updated above but From plot, It looks something wrong.
Could you please check the plot?