add local data storage function