Better handing of closing