getFirst out of bounds error fixed