PB solving index out of bound 2