moved write and read functions to filestore file