Change dataaccess to only write to disk when a page is closed