added main thread creation