multiThreading seems to works but needs improvments