saving state when onDestroy() is called
Updated test cases for class