Off By One error fix