added some code for store functionality