added function for threads back in