fix KeyStore caching

loaded is never set to true so cache will never be used