fix two bugs:
1. case when node jump to itself
2. case when no real heads