changed the order of starting of threads.