fixed ioobe via thread issues