added ending switch

ending