correct thread creation