bug fixed for exit tree