fixed off by one error with new sanity checks