Hopefully fixed the string out of bounds error.