only delete globals at the very end