making sure the cache starts and closes the client