Add main to test thread