hot fix for off-by-one referencing issue