Why </p> tag appears after the second script block instead of appearing before the first script block?