The scheme will protect the town from future flooding