Remove items from workspace before closing function