Made state changes async.