Function checkContextFit