ensure keystone is applied when it is needed