Fixed the logic on isClosed.