Code that makes sure that the correct store gets updated