fix 'off by 2' crash