Terminated  Array iNdex out of bounce in Astar