fix of Indexofbound exception