Do you only get the two emails when you have the extra line of code on the page? When you added the extra code to the page did you add both lines in addition to the code that was already on the page or did you replace the one line with the two lines of code?
The first line of that sample code should already be in place on your page. If you just added the two new lines of code then you would ge the email twice because the code would execute twice. Please post back with the details so we can look into this further.