A man ended up shooting himself and his friend when he tried to unjam a 9mm semi-automatic handgun at a shooting range on Sunday, police in Florida said.

According to the Orlando Sentinel, the men were at the Shoot Straight gun range in Casselberry, Fla. One of them tried to unjam the handgun but accidentally pulled the trigger, shooting himself in the finger, police told the paper. The bullet went through his friend’s thigh and ended up in a nearby wall, police said.

Both men were expected to recover, Sgt. Mark Stein told the newspaper. They were taken to the hospital, Stein said. Neither of their names were released.

A witness quoted by the Sentinel called it “just a case of stupidity.”