Finished createHubThread funtion