PB solving index out of bound