isClosed was comparing state pointers, not states themselves