fixed saveState