A U.S. Coast Guard helicopter crew rescued seven cold, stranded boaters from a Chilkat River sandbar in a midnight rescue near the Southeast Alaska town of Haines early Sunday morning.

The boaters, Gary Hinkle, 30, Sierra Hinkle, 29, Brittany Miller, 24, Vincent Simkin, 25, Caullen Taylor, 24, Katie Torguson, 30, and Joliena Wilson, 22, were about 10 miles up the Chilkat River when their boats ran aground on a sandbar, according to the Alaska State Troopers.

The group was wet and didn’t have enough gear to stay dry overnight on the sandbar, with temperatures dropping and hypothermia setting in. Temperatures dropped into the 30s in the area Saturday night, troopers said.

Fortunately the group was carrying a device that allowed them to call for help despite the remote location, which “probably saved their lives,” said U.S. Coast Guard Lt. Cmdr. Joseph Plunkett.

The group had a DeLorme-brand satellite transmitter device that “provided their exact location,” said Alaska State Troopers spokesman Tim DeSpain.

They called for help at about 9:45 p.m., according to troopers.

A U.S.Coast Guard helicopter from Sitka flew to the scene and picked up the seven people and their dog just before 1 a.m., flying them to Haines for a medical check up. No one was injured.

“This is a great example of how a sunny day in Alaska can quickly turn into survival situation,” Plunkett said in a statement.