#81 cleanup thread variables