BOSTON (AP) — A Legislative committee is backing a bill that would create a uniform warning and safety flag program for all Massachusetts beaches.

The bill calls on the Department of Conservation and Recreation to create a color-coded system that communities can participate on a voluntary basis.

The goal is to warn the public of potentially hazardous conditions like riptides.

The Joint Committee on Environment formally backed the bill after a public hearing Tuesday. The bill now heads to the full Senate.

The bill's sponsor, Gloucester Republican Sen. Bruce Tarr, said the idea came from David Harrison, whose 2-year-old niece Caleigh Harrison went missing from Rockport's Long Beach more than a year ago. She's believed to have drowned.

Tarr said New Hampshire is the only New England state with a uniform warning and safety flag program for its beaches.