update code for core thread