You are right, but this kind of dangling modifier is actually very common even in careful English, and there is no harm done unless confusion is caused or humor is generated.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.