fix the problem of : step go out of slnList range.
increase robustness of the code.