fix for off-by-one error.