Replace start and join of main thread with run