Promela, Ispin: Model checker promela modeling with spin

I'm working on model checking verification using spin model checker each time I try to run code I get error:

spin: traffic_controller:12, Error: undeclared variable: to_green saw '')' = 41'

child process exited abnormally also i have declared it already. I am using spin version 6.4.9

1   proctype traffic_controller(int id; int red; int green; int yellow)
3   {
4   bool event_flag = false;
5   int neighbor_id , send_node_id , interval ;
6   byte circular_ch[4];
7   mtype  msg_signal  ;
9   end_1 :
10  do
11  ::circular_ch[ id ]?msg_signal (send_node_id);
12  if
13  :: ( msg_signal == to_green ) ;
14  green_state:
15  if
16  :: interval = GREEN_INTERVAL0 ;
17  :: interval = GREEN_INTERVAL1 ;
18  :: interval = GREEN_INTERVAL2 ;
19  fi;
20  set (clock [id] , interval) ;
21  red_activated_region_end :
22  red_signal [id] = false ;
23  green_activated_region_start ;
24  green_signal [id] = true ;
25  if
26  :: ( expire ( clock [id] ) ) -> clock [id] = ZERO;
27  green_activated_region_end :
28  green_signal [id] = false ;
29  goto yellow_state ;
30  fi;
31  yellow_state :
32  set ( clock [id] , YELLOW_INTERVAL ) ;
33  yellow_activated_region_start ;
34  yellow_signal [id] = false ;
35  if
36  :: ( expire ( clock [id] ) ) -> clock [id] = ZERO ;
37  yellow_activated_region_end :
38  yellow_signal [id] = false ;
39  if
40  :: (id != NUM_NODES-1) -> neighbor_id = id+1 ;
41  ::else -> neighbor_id =ZERO;
42  fi;
43  red_signal [id] = true;
44  red_activated_region_start :
45  circular_ch [ neighbor_id ] ! to_green (id) ;
46  fi;
47  fi;
48  od;
49  }
50  init
51  {
52  run traffic_controller();
53  mtype : msg_signal = { to_green, pear, banana }
54  }