Fixed threading error.