updated storeData function