first restore last accessed buffer, then delete to avoid close window