fixed segfault in isClosed