one thread for logic