saving state revamped