This is known as a "dangling participle". That is, the participle isn't modifying the subject of the sentence. It is considered an error by many style guides. I found this in a quick google search:
In the sentence below, the modifying clause (Rushing to catch the bus) contains a participle (rushing). The participle is said to be dangling because the subject of the main clause (Bob's wallet) is not the thing modified by the initial modifying clause. It was not Bob's wallet that was rushing.
Rushing to the catch the bus, Bob's wallet fell out of his pocket.
Of course, dangling participles occur all the time in normal English usage, so unconditionally considering them an error might be a bit strict. I found Steven Pinker on Why It’s Okay to Dangle Your Participle:
You’re not a fan of the “Gotcha gang,” as you call them — folks who take a narrow view of usage that often relies on questionable rules. You write, “In their zeal to purify usage and safeguard the language, they have made it difficult to think clearly about felicity and expression and have muddied the task of explaining the art of writing.” Can you expand on that a little?
Absolutely. Many purists have remarkably little curiosity about the history of the language or the scholarly tradition of examining issues and usage. So a stickler insists that we never let a participle dangle, that you can’t say, “Turning the corner, a beautiful view awaited me,” for example. They never stopped to ask, “Where did that rule come from and what is its basis?” It was simply taught to them and so they reiterate it.
But if you look either at the history of great writing and language as it’s been used by its exemplary stylists, you find that they use dangling modifiers all the time. And if you look at the grammar of English you find that there is no rule that prohibits a dangling modifier. If you look at the history of scholars who have examined the dangling modifier rule, you find that it was pretty much pulled out of thin air by one usage guide a century ago and copied into every one since, And you also find that lots of sentences read much better if you leave the modifier dangling.
So all of these bodies of scholarship, of people who actually study language as it’s been used, language as its logic is dictated by its inherent grammar — that whole body of scholarship is simply not something that your typical stickler has ever looked up.
It sounds like the culprit here is outdated or useless rules.
Yes, combined with the psychology of hazing and initiation rites, namely, “I had to go through it and I’m none the worse — why should you have it any easier?”
Further reading: Does it really matter if it dangles? on Language Log
Originally posted here