added std::before exit