Perfect way to end the thread