more robust closing