Fixed check for Out of Bounds