changed sharedSession to be foregroundSession to avoid confusion