Added Exit Logic