improve async ctx management