Attempt at thread exiting