Fix thread (future) crash