Fixed bug with accessing outside of sequence