Fix problem with the async context being cleared to early