fixed the passing to thread arg bug