Fixed outofbounds exception