Massachusetts adopted the country’s toughest ban on the sale of flavored tobacco and vaping products, including menthol cigarettes, in response to a rise in youth vaping and an outbreak of vaping-related serious lung injuries.

A Massachusetts judge ruled that a four-month ban on the sale of vaping products the state adopted in response to an outbreak of lung illnesses linked to e-cigarette use was likely “unlawful,” but he gave the state time to fix its defects.

Massachusetts imposed a four-month ban on sales of all vaping products, amid what officials called a national public health emergency that so far has been linked to nine deaths.