adding saving to bg thread