fix context key check on optional panels