Remove unneeded IllegalStateException in close