fixed bug indexOutArray in Piyavskyi