fixes watershed max id writing error