persistData working version