code has been extended into filestore.php