prepare for thread control