Debug the writeState()...1