update off by 1 issue