Added the thread parameter