Attempting to make it save and restore state, but failed