string out of bound fix