Fixed an Out of bounds exception