hot-fix for off-by-one error