fix off by one