can we make this a `if (!closed) {}`