Error Out of bounds error fixed