A participle or participial phrase is naturally referred to the nearest nominative.If only one nominative is expressed it claims all the participles that are not by the construction of the sentence otherwise fixed. "John, working in the field all day and getting thirsty, drank from the running stream." Here the participles working and getting clearly refer to John. But in the sentence,—"Swept along by the mob I could not save him," the participle as it were is lying around loose and may be taken to refer to either the person speaking or to the person spoken about. It may mean that I was swept along by the mob or the individual whom I tried to save was swept along.
"Going into the store the roof fell" can be taken that it was the roof which was going into the store when it fell. Of course the meaning intended is that some person or persons were going into the store just as the roof fell.
In all sentence construction with participles there should be such clearness as to preclude all possibility of ambiguity. The participle should be so placed that there can be no doubt as to the noun to which it refers. Often it is advisable to supply such words as will make the meaning obvious.