Cities take safety precautions for Fourth of July celebrations