Change to avoid deadlock on main thread.