add some more debug output while storing state