making thread end safely