added restoring fn