out of bounds error fix