Which sentence contains a dangling modifier?

AUpon taking the field, the player was hit by a foul ball.
BWhen operating heavy machinery, one must use caution.
CUpon bestowing the awards, the mayor congratulated all the participants.
DUpon hearing the fire engines, the apartment building was evacuated.