Do not forget to restore state