Updated the storeData function