MARGATE, N.J. (CBS) — An Atlantic County judge has approved an injunction to stop a controversial dune construction project in Margate.

On Thursday, the judge sided with Margate and put a stop to the project until a new drainage solution is put into effect.

“It’s really hurting the beach, it’s really hurting the city, the city’s economy, children who are getting these weird rashes, lifeguards who are going out on disability because they’re getting sick from guarding the ponds,” said the city’s attorney Jordan Rand.

The judge agreed and said for the next seven days, both parties–the Department of Environmental Protection, their contractor & Margate officials–must sit down and hammer out a drainage resolution

Recent heavy rains left large pools of water on Margate’s beaches. The pools are sitting in newly built, state-ordered sand dunes and created what officials call a safety hazard. The Army Corps of Engineers is working to pump the water out.

Gov. Chris  Christie ordered the dunes after Hurricane Sandy.

Mayor Michael Becker says the community fought the dune-building project from its inception, arguing their town is already protected from the ocean by bulk heads.

Margate has temporarily closed most of its beaches after tests showed high levels of bacteria in the ponding dune water, 18 inches deep in some parts.