Fixed index out of bounds problem
Fix indexed out of bounds error