Close back end upon exit