fixed thread creation