When was a dam built for the river?