Added check for external context.