added Main thread to wait for multiple child threads