changed how threading works - more proper