CHEEKTOWAGA, N.Y. — When it rains, it pours and for decades, oftentimes it's raw sewage pouring into Scajaquada Creek, which runs from Lancaster through Cheektowaga and Buffalo, into the Niagara River.

"Resulting in Scajaquada Creek, generations later, being one of the most polluted waterways in the entire state of New York," said Sen. Tim Kennedy (D - Buffalo).

Outdated sewer systems are partly to blame for the problem. When there's too much water for the sanitary system to handle, the excess sewage is forced into the creek.

In the Town of Cheektowaga, $25 million in grants and loans from the state are helping fix some of the issues. As part of an order from the Department of Environmental Conservation, crews are relining old, often cracked pipes to reduce ground water seeping into the sewer and overloading the system. Thirty percent of the town's pipes have been relined, resulting in 55 percent less sewage flowing into the creek compared to 2011, according to officials.

The old pipes aren't the only culprits. Officials urge homeowners to make sure sump pumps and storm spouts do not illegally hook up to the sewer, adding more water to the system when it rains. Currently, connections are checked when homes are sold, or residents can call the town to take a look. Officials want to avoid forcing their way into people's homes.

There's still a long way to go, and with hundreds of miles of pipes still needing work, the town is applying for $5 million more in state aid to continue the project and help keep sewage out of the Scajaquada.

"I don't know if we'll ever eliminate all the bypasses, but obviously I think we can make a lot of progress," said Cheektowaga Town Engineer Pat Bowen.