Circumvent out of bounds error