fixing the set all mode off by 1 error.