Change $segment to $vars