i is defined in sync context but later used in async call