Update function to manage secret store