Using the main thread