multithreading working perfectly