modify main thread method